package com.cdu.ai_intelligent_teaching_and_training_system.mapper;

import com.cdu.ai_intelligent_teaching_and_training_system.entity.Teacher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TeacherMapper {
    
    // 插入教师
    int insert(Teacher teacher);
    
    // 根据ID查询教师
    Teacher selectById(@Param("teacherId") Long teacherId);
    
    // 根据用户ID查询教师
    Teacher selectByUserId(@Param("userId") Long userId);
    
    // 根据邮箱查询教师
    Teacher selectByEmail(@Param("email") String email);
    
    // 查询所有教师
    List<Teacher> selectAll();
    
    // 更新教师
    int update(Teacher teacher);
    
    // 删除教师
    int deleteById(@Param("teacherId") Long teacherId);
    
    // 检查邮箱是否存在
    int countByEmail(@Param("email") String email);
}
